<%= header %>
<!--
The spa route change back to home is filtered and will trigger an xhr beacon instead
-->
<%= boomerangScript %>
<script src="support/function-bind-polyfill.js" type="text/javascript"></script>

<base href="/pages/12-react/24-route-filter.html" />

<script type="text/javascript">
window.imgs = [3000];
window.html5_mode = true;

// view a widget then come back so debugging (F5) is easier
window.nav_routes = ["/widgets/1", "/"];

// filter out the 2nd home nav
var navs = 0;
window.history_route_filter = function() {
	return (++navs) <= 1;
};
</script>

<div id="root"></div>

<script src="support/app.js"></script>

<script src="/test-templates/spa/24-route-filter.js" type="text/javascript"></script>
<script src="24-route-filter.js" type="text/javascript"></script>

<script>
// React will cause 2 XHRs for the 2nd home nav, filter one of them out using
// an excludeFilter so that the test template doesn't need special handling
BOOMR_test.init({
	testAfterOnBeacon: 3,
	History: {
		enabled: true
	},
	instrument_xhr: true,
	autorun: false,
	AutoXHR: {
		excludeFilters: [{
			cb: function(anchor) {
				var url = anchor.href, result;
				if (url && typeof url === "string") {
					result = url.match(/support\/home\.html/g);
					if (result && result.length > 0) {
						return true;
					}
				}
				return false;
			},
			ctx: null,
			name: "24-route-filter"
		}]
	}
});
</script>
<%= footer %>
